#ifndef TEACHER_H
#define TEACHER_H

#include <QObject>
#include <QMap>
#include <QStringList>
#include <QTimer>
#include "task-provider.h"
#include "testing-panel.h"

namespace Core
{

class Teacher : public QObject
{
    Q_OBJECT
private:
    QMap<QString, ITaskProvider*> _providers;
    QStringList _enabledProviders;
    QTimer _timer;
    TestingPanel _testingPanel;

    QWidget* _prepareTestingPanel();
    void _hideTestingPanel();
public:
    explicit Teacher(QObject *parent = 0);
    ~Teacher();

    void registerProvider(ITaskProvider* provider);    

signals:
    void answered(bool correct, int score, const QString problemsDecription);
    void logMessage(const QString& message);
    void logError(const QString& message);

public slots:
    void start();
    void stop();
    void showTask();
    void hideTask();

    void enableProvider(const QString& providerName);
    void disableProvider(const QString& providerName);
    void setInterval(int secInterval);

    void taskFinished();
};

}

#endif // TEACHER_H
